<div class="row-fluid">
    <div class="span12">
        <div class="box gradient hover">
            <div class="title">
                <h4>Hồ sơ cá nhân</h4>
            </div>
            <div class="content">
                <?php if (0 != count($form->getErrorSchema()->getErrors())) : ?>
                    <div class="alert alert-error">
                        <button type="button" class="close" data-dismiss="alert">&times;</button>
                        <ul>
                          <?php foreach($form->getWidgetSchema()->getPositions() as $widgetName): ?>
                            <?php if($form[$widgetName]->hasError()): ?>
                            <li><?php echo $form[$widgetName]->renderLabelName().': '.$form[$widgetName]->getError()->getMessageFormat(); ?></li>
                            <?php endif; ?>
                          <?php endforeach;?>
                        </ul>
                        <?php if (0 == count($form->getErrorSchema()->getErrors())):?>
                        <?php echo $form->renderGlobalErrors()?>
                        <?php endif?>
                    </div>
                <?php endif; ?>
                <div class="row-fluid <?php echo (0 != count($form->getErrorSchema()->getErrors()))?"marginT20":""?>">
                    <div class="span12">
                        <form action="<? echo (isset($staff_id) ? url_for('@staff_edit?id='.$staff_id) : url_for('@staff_create'))?>" method="post" enctype="multipart/form-data">
                            <ul class="nav nav-tabs">
                              <li class="active">
                                <a href="#infos" data-toggle="tab">Thông tin chung</a>
                              </li>
                              <?php if (isset($staff_id) && $staff): ?>
                                  <li><a href="#transfers" data-toggle="tab">Quá trình công tác</a></li>
                                  <li><a href="#educations" data-toggle="tab">Chuyên môn đào tạo</a></li>
                                  <li><a href="#files" data-toggle="tab">Hồ sơ lưu trữ</a></li>
                                <?php endif ?>
                            </ul>
                            <div class="tab-content frmWrapper">
                                <div class="tab-pane active" id="infos">
                                    <? echo include_partial('infos_tab', array('form' => $form, 'profile_form' => $profile_form, 'staff' => (isset($staff) ? $staff : null))) ?>
                                </div>
                                <?php if (isset($staff_id) && $staff): ?>
                                    <div class="tab-pane" id="transfers">
                                        <? echo include_partial('transfers_tab', array('form' => $form, 'staff' => (isset($staff) ? $staff : null), 'pub_organizations' => (isset($pub_organizations) ? $pub_organizations : null), 'staff_pub_organization_form' => $staff_pub_organization_form, 'staff_transfer_form' => $staff_transfer_form, 'staff_event_form' => $staff_event_form)) ?>
                                    </div>
                                    <div class="tab-pane" id="educations">
                                        <? echo include_partial('educations_tab', array('form' => $form, 'staff' => (isset($staff) ? $staff : null), 'staff_education_backgrounds' => (isset($staff_education_backgrounds) ? $staff_education_backgrounds : null), 'staff_education_background_form' => $staff_education_background_form)) ?>
                                    </div>
                                    <div class="tab-pane" id="files">
                                        <? echo include_partial('files_tab', array('elfinder_connector' => $elfinder_connector)) ?>
                                    </div>
                                <? endif ?>
                            </div>
                            <div style="text-align:center">
                                <button type="submit" class="btn btn-info marginR10">Lưu</button>
                                <a href="<?php echo url_for("@staff_index")?>" class="btn btn-warning">Quay lại</a>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
